﻿/// <reference path="../libraries/jquery-1.6.4.min.js" />
/// <reference path="../libraries/jquery.mobile-1.4.0.min.js" />
/// <reference path="errorobjects/customerror.js" />

var Logger = (function () {
    logFileUrl = "../logs/errors/errorlog.txt";

    var getFileName = function () {
        var date = new Date();

        var day = date.getDate();
        if (day < 10) {
            day = "0" + day;
        }

        var month = date.getMonth() + 1;
        if (month < 10) {
            month = "0" + month;
        }

        var dateString = day + "/" + month + date.getFullYear();

        return "Log:" + dateString;
    }

    var logError = function(error) {
        var fileName = getFileName();
        var fso = new ActiveXObject("Scripting.FileSystemObject");
        var file = fso.OpenTextFile(logFileUrl);

        file.WriteLine("test");
    }

    return {
        logError: logError
    }
}())
